#ifndef __FIFO_H__
#define __FIFO_H__

#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>

typedef struct
{
    uint8_t *buffer;
    uint32_t size;
    uint32_t in;
    uint32_t out;
}fifo_t;

uint8_t fifo_init(fifo_t *fifo, uint8_t *buffer, uint32_t size);
uint32_t fifo_put(fifo_t *fifo, uint8_t *buffer, uint32_t len);
uint32_t fifo_get(fifo_t *fifo, uint8_t *buffer, uint32_t len);
uint32_t fifo_length(fifo_t *fifo);

#endif /* __FIFO_H__ */
